<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/29
 * Time: 17:10
 */

namespace iBrand\Shop\Backend\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller as BaseController;

abstract class Controller extends BaseController
{
	use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

	public function ajaxJson($status = true, $data = [], $code = 200, $message = '')
	{
		return response()->json(
			['status'    => $status
			 , 'code'    => $code
			 , 'message' => $message
			 , 'data'    => $data]
		);
	}
}